<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <th:block th:include="common/common::common('菜单管理')"/>
        <script src="/static/base/menu/index.js" charset="utf-8"></script>
    </head>
    <body class="bg-color">
        <div class="body_info">
            <input type="text" th:value="*{parentId}" id="parentId" name="parentId" style="visibility: hidden;">
            <div class="data_div">
                <!-- 按钮、搜索框 -->
                <div class="tool-bar-head">
                    <div class="tool-bar-head-left">
                        <button shiro:hasPermission="base:menu:add"
                                class="layui-btn layui-btn-sm layui-btn-normal" onclick="saveBaseMenu()">
                            <i class="layui-icon"></i>新增
                        </button>
                    </div>
                    <div class="tool-bar-head-right">
                        <form class="layui-form layui-form-pane" onsubmit="javascript:return false;">
                            <div class="layui-form-item query">
                                <label class="layui-form-label" style="padding-right: 0;">名称</label>
                                <div class="layui-input-inline" style="margin-right:0;">
                                    <input class="layui-input" id="name" name="name"
                                           onchange="javascript:$('#searchBtn').click();">
                                </div>
                                <button id="searchBtn" class="layui-btn layui-btn-normal" data-type="reload">搜索</button>
                            </div>
                        </form>
                    </div>
                </div>

                <!-- 表格 -->
                <div class="layui_table">
                    <table class="layui-hide" id="layTable" lay-filter="baseMenuLay"></table>
                    <div id="layPage"></div>
                </div>
            </div>
        </div>

        <!-- 操作工具栏 -->
        <script type="text/html" id="toolbarHandle">
            <a shiro:hasPermission="base:menu:see" class="tool-bar-btn see-button" lay-event="see">查看</a>
            <a shiro:hasPermission="base:menu:edit" class="tool-bar-btn edit-button" lay-event="edit">编辑</a>
            <a shiro:hasPermission="base:menu:del" class="tool-bar-btn remove-button" lay-event="del">删除</a>
        </script>

        <script type="text/html" id="visibleTemplate">
            <input type="checkbox" name="visible" value="{{d.id}}" lay-skin="switch" lay-text="显示|隐藏"
                   lay-filter="visibleTemplate" {{ d.visible== '1' ? 'checked' : '' }}>
        </script>
    </body>
</html>